﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DC2010
{
    public class QueueEx<T> : Queue<T>
    {
        public event EventHandler Enqueed;
        public event EventHandler Dequeed;

        public void AddToQueue(T t)
        {
            Enqueue(t);

            if (Enqueed != null) Enqueed(t, null);
        }

        public T RemoveFromQueue()
        {
            T t  = Dequeue();
            if (Dequeed != null) Dequeed(t, null);

            return t;
        }
    }
}
